package com.pollux.entity;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import java.io.Serializable;
import java.time.LocalDateTime;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Data
@AllArgsConstructor
@NoArgsConstructor
/**
 * @TableName history
 */
public class History implements Serializable {

    /**
     * 主键
     */
    @NotNull(message = "[主键]不能为空")
    @Schema(name = "id", description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer id;

    /**
     * 帖子标题
     */
    @NotBlank(message = "[帖子标题]不能为空")
    @Size(max = 50, message = "编码长度不能超过50")
    @Schema(name = "postTitle", description = "帖子标题", maxLength = 50, requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 50, message = "编码长度不能超过50")
    private String postTitle;

    /**
     * 浏览时间
     */
    @NotNull(message = "[浏览时间]不能为空")
    @Schema(name = "browseTime", description = "浏览时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime browseTime;

    /**
     * 帖子id
     */
    @NotNull(message = "[帖子id]不能为空")
    @Schema(name = "postId", description = "帖子id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer postId;

    /**
     * 类型。历史记录和收藏夹的表结构一致，那么直接用一个类型就标识谁是历史谁是收藏即可。
     */
    @NotNull(message = "[类型。历史记录和收藏夹的表结构一致，那么直接用一个类型就标识谁是历史谁是收藏即可。]不能为空")
    @Schema(name = "type", description = "类型。历史记录和收藏夹的表结构一致，那么直接用一个类型就标识谁是历史谁是收藏即可。", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer type;

    /**
     * 逻辑删除。1为已删除
     */
    @NotNull(message = "[逻辑删除。1为已删除]不能为空")
    @Schema(name = "isDelete", description = "逻辑删除。1为已删除", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer isDelete;

    /**
     * 记录创建时间
     */
    @NotNull(message = "[记录创建时间]不能为空")
    @Schema(name = "createTime", description = "记录创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @NotNull(message = "[创建人id]不能为空")
    @Schema(name = "createId", description = "创建人id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer createId;

    /**
     * 最后修改时间
     */
    @NotNull(message = "[最后修改时间]不能为空")
    @Schema(name = "updateTime", description = "最后修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
    private LocalDateTime updateTime;

    /**
     * 最后修改人id
     */
    @NotNull(message = "[最后修改人id]不能为空")
    @Schema(name = "updateId", description = "最后修改人id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer updateId;
}
